package com.kinyx.framework.file;

import org.junit.Assert;
import org.junit.Test;

public class KPathUtils_Tester_path2package {

	@Test
	public void test() {
		Assert.assertEquals(null, KPathUtils.path2package(null));
		Assert.assertEquals(null, KPathUtils.path2package("null"));

		Assert.assertEquals("", KPathUtils.path2package(""));
		Assert.assertEquals("", KPathUtils.path2package(" "));

		Assert.assertEquals("null", KPathUtils.path2package(" null "));
		Assert.assertEquals("foo", KPathUtils.path2package("foo"));
		Assert.assertEquals("foo", KPathUtils.path2package(" foo "));

		Assert.assertEquals("com.kinyx.framework.file.KPathUtils", KPathUtils.path2package("com/kinyx/framework/file/KPathUtils"));
		Assert.assertEquals("com.kinyx.framework.file.KPathUtils", KPathUtils.path2package("com\\kinyx\\framework\\file\\KPathUtils"));

		Assert.assertEquals("com.kinyx.framework.file.KPathUtils", KPathUtils.path2package("/com/kinyx/framework/file/KPathUtils"));
		Assert.assertEquals("com.kinyx.framework.file.KPathUtils", KPathUtils.path2package("\\com\\kinyx\\framework\\file\\KPathUtils"));

		Assert.assertEquals("com.kinyx.framework.file.KPathUtils", KPathUtils.path2package("com/kinyx/framework/file/KPathUtils/"));
		Assert.assertEquals("com.kinyx.framework.file.KPathUtils", KPathUtils.path2package("com\\kinyx\\framework\\file\\KPathUtils\\"));

		Assert.assertEquals("com.kinyx.framework.file.KPathUtils", KPathUtils.path2package("/com/kinyx/framework/file/KPathUtils/"));
		Assert.assertEquals("com.kinyx.framework.file.KPathUtils", KPathUtils.path2package("\\com\\kinyx\\framework\\file\\KPathUtils\\"));
	}

}
